package cn.bo.cloud.common.core.enums;

public enum ResultCode {

    SUCCESS(0, "成功"),
    ERROR(1000, "失败"),
    PARAM_INVALID(2001, "参数验证失败,不符合要求"),
    PARAM_INJECTION_RISK(2002, "参数验证失败,参数不符合防注入要求"),
    SIGNATURE_FAIL(2003, "参数签名验证失败"),
    REQUEST_ERROR(4000, "请求错误"),
    DUPLICATE_REQUEST(4001, "接口请求次数过多"),
    FAILURE_REQUEST(4002, "请求失败，请求类型、参数、头信息可能存在问题"),
    UNAUTHORIZED(4003, "身份认证失败"),
    NO_PERMISSION(4003, "无权限访问该资源"),
    USER_BLACK(4003, "账户被限制"),
    USER_FORBIDDEN(4003, "账户被冻结"),
    SERVER_ERROR(5000, "服务器内部错误"),
    SERVER_RESULT_NULL(5001, "返回结果不存在或为空值"),
    SERVER_RESULT_ERROR(5002, "返回结果解析异常"),
    SERVER_JSON_ERROR(5003, "服务JSON数据解析异常"),
    SERVER_IO_ERROR(5004, "服务IO异常"),
    SERVER_NET_ERROR(5005, "服务网络异常"),
    TIMEOUT(5006, "超时"),
    TOP_LIMIT(5007, "超出上限");


    private final int code;
    private final String message;

    ResultCode(int code, String message){
        this.code = code;
        this.message = message;
    }

    public int code(){
        return this.code;
    }

    public String message(){
        return this.message;
    }

}
